#include "libul.h"

HCSR04 ultrasonic;

extern "C" int ul_init(int trigger, int echo)
{
     if (wiringPiSetupGpio() == -1)
        return -1;
   
     ultrasonic.init(trigger, echo);
     return 1;
};

extern "C" double ul_distance(int timeout)
{
 return ultrasonic.distance(timeout);
} 
